<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>功夫豆后台</title>
    <link type="text/css" rel="stylesheet" href="__PUBLIC__/manage/login/css/normalize.css" />
    <link type="text/css" rel="stylesheet" href="__PUBLIC__/manage/login/css/demo.css" />
    <!--必要样式-->
    <link type="text/css" rel="stylesheet" href="__PUBLIC__/manage/login/css/component.css" />
    <!--[if IE]>
    <script src="js/html5.js"></script>
    <![endif]-->
</head>

<body>
<div class="container bg">
    <div class="content">
        <div id="large-header" class="large-header">
            <canvas id="demo-canvas"></canvas>
            <div class="logo_box">
                <h3>功夫豆后台管理系统</h3>
                <form action="{:url('manage/Login/doLogin')}" name="f" method="post" >
                    <div class="input_outer">
                        <span class="u_user"></span>
                        <input id="username" class="text" style="color: #FFFFFF !important" type="text" placeholder="请输入账户">
                    </div>
                    <div class="input_outer">
                        <span class="us_uer"></span>
                        <input id="userpass" class="text" style="color: #FFFFFF !important; position:absolute; z-index:100;"value="" type="password" placeholder="请输入密码">
                    </div>
                    <div class="mb2"><a class="act-but submit" onclick="login()" style="color: #FFFFFF">登录</a></div>
                </form>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript" src="__PUBLIC__/manage/login/js/TweenLite.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/manage/login/js/EasePack.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/manage/login/js/rAF.js"></script>
<script type="text/javascript" src="__PUBLIC__/manage/login/js/demo-1.js"></script>
<script type="text/javascript" src="__PUBLIC__/plugs/jquery/jquery.min.js"></script>
<script type="text/javascript">

    function login(){
        var username  = $('#username').val();
        var userpass  = $('#userpass').val();
        if(username==""||username.length>50)
        {
            alert('请输入正确的用户名！');
            return;
        }
        if(userpass==""||userpass.length<6||userpass.length>20)
        {
            alert("请输入正确的密码！");
            return;
        }
        $.ajax({
            url: $("form").attr("action"),
            type: 'post',
            dataType: 'json',
            data:{
                username: username,
                userpass:userpass
            },success:function(data){
                if (data.code == 0) {
                    location.href = '/manage/Index/index';
                } else {
                    alert(data.message)
                }
            }

        })
    }



</script>

</body>
</html>